-
Notifications
You must be signed in to change notification settings - Fork 128
Refactored fcl-core wallet-utils folder files to TypeScript #2478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored fcl-core wallet-utils folder files to TypeScript #2478
Conversation
|
}).toThrow(Error) | ||
}) | ||
|
||
test("encode account proof with missing appIdentifier", () => { | ||
expect.assertions(1) | ||
expect(() => { | ||
encodeAccountProof({address, nonce}) | ||
encodeAccountProof({address, nonce} as any) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not AccountProofData
with appIdentifier
omitted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and set AccountProofData with optional properties
export const ready = (cb, msg = {}) => { | ||
export const ready = ( | ||
cb: (data: any, context: {origin: string}) => void, | ||
msg: PollingResponse = {} as PollingResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg: PollingResponse = {} as PollingResponse |
Looks like msg
is unused here. IMO we should maybe just take this opportunity to drop it. The risk is that users could get type errors for this if they were passing an (unused) msg arg here, but functionally this should not break anything so I think it's worth it for the long term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to me it makes completely sense because it's useless. If we want to maintain backward compatibility we could still leave it but make it optional like it is done in the sendMsgToFCL method. What do you think?
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
sendMsgToFCL("FCL:VIEW:RESPONSE", { | ||
f_type: "PollingResponse", | ||
f_vsn: "1.0.0", | ||
status: "DECLINED", | ||
reason: reason, | ||
data: null, | ||
}) | ||
} as PollingResponse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these type assertions necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore, removed!
Close #2452